#!/usr/bin/perl
use strict;
use warnings;

my ( $value, $from, $to, $rate, %rates );

%rates = (
	pound          => 1,
	dollar         => 1.6,
	mark           => 3.0,
	"frech france" => 10.0,
	yen            => 174.8,
	"swiss franc"  => 2.43,
	euro           => 1.5
);

print "starting currency:	";
$from = <STDIN>;
print "target currency: ";
$to = <STDIN>;
print "ammount: ";
$value = <STDIN>;

chomp( $from, $to, $value );

if ( not exists $rates{$to} ) {
	die "you not enter target curr \n";
}

$rate = $rates{$to} / $rates{$from};

print "$value $from is  ", $value * $rate, " $to. \n";

